Begins collection of a batch of documents to register in the Publisher queue.
Syntax
Function BeginBatch (vaultId, commitSize)
| Name | Description |
|---|---|
|
vaultId |
A string that uniquely identifies the vault in which the document resides. Specify Nothing or an empty string to work in the same vault where the VBScript runs. The vault identifier has the syntax \\server\vault, where server is the name of the server computer and vault is the internal name of the vault or datastore. The vault identifier may consist of only a vault name, in which case the vault’s default server, if set, will be assumed. |
|
commitSize |
The number of documents to send to the server as a single transaction. The default is 0, all documents in the batch are sent as one transaction. |
Remarks
This method must be called in the _Initialize event procedure of a custom command, similar to the following examples. If this is not done, then the RegisterDocument method registers documents in the queue individually.
If any document is registered more than once, the Publisher configuration options described in the BlueCielo Meridian Enterprise Administrator's Guide will determine the disposition of the batch.
Example
The following examples demonstrate how to do batch publishing either in a server-side process (better performance and recommended) or a client-side process (if a client context is required).
Note The server-side example relies on the account under which the EDM Server service is running to have access to the Meridian Enterprise Server web service.
Sub Publish_Batch_Execute(Batch)
AddToBatch Batch, Document
End Sub
Sub Publish_Batch_Initialize(Batch)
BeginBatch(Batch)
End Sub
Sub Publish_Batch_Terminate(Batch)
CommitBatch(Batch)
If Err.Number = 0 Then
WinMsgBox ("Documents have been registered for publishing")
End If
If Err.Number <> 0 Then
WinMsgBox Err.Description
Err.Clear
End If
End Sub
Public Sub BeginBatch(Batch)
Dim QueueObject
' Server side batch. For client side batch, pass False instead
Set QueueObject = AMCreateObject("BCPublisher.MeridianQueue", True)
Batch.Argument("PublisherBatch") = QueueObject
QueueObject.BeginBatch
End Sub
Public Sub CommitBatch(Batch)
On Error Resume Next
Dim QueueObject
Set QueueObject = Batch.Argument("PublisherBatch")
Batch.Argument("PublisherBatch") = Nothing
If Not (QueueObject Is Nothing) Then
QueueObject.CommitBatch
QueueObject.Dispose()
End If
If Err.Number <> 0 Then
Err.Raise Err.Number, Err.Source, _
"Failed to publish batch of documents: " + Err.Description
End If
End Sub
Public Sub AddToBatch(Batch, Document)
Dim QueueObject
Set QueueObject = Batch.Argument("PublisherBatch")
If Not (QueueObject Is Nothing) Then
Call QueueObject.RegisterDocument("", "1B4423", Document.ID, , , , , ,"")
End If
End Sub
Related concepts
Related information